﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>${tpl.get('page_title') or u'登录_沃云网络无线网络'}</title>

    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
    <link href="${requri}/static/common/public/sz-telecom/zglt/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="${requri}/static/common/public/sz-telecom/zglt/css/font-awesome.min.css">
    <link href="${requri}/static/common/public/sz-telecom/zglt/css/style.css" rel="stylesheet" type="text/css">
    <style>
        .clr {
            clear: both;
        }
    </style>
    <script src="${requri}/static/common/images/iscroll4.1.9.js"></script>
    <link href="${requri}/static/common/css/mini.css" rel="stylesheet" type="text/css"/>
    <script src="${requri}/static/js/jquery-1.11.0.min.js"></script>


    <script type="text/javascript">
        // 初始化幻灯
        var myScroll;
        function loaded() {
            myScroll = new iScroll('wrapper', {
                snap: true,
                momentum: false,
                hScrollbar: false,
                onScrollEnd: function () {
                    document.querySelector('#indicator > li.active').className = '';
                    document.querySelector('#indicator > li:nth-child(' + (this.currPageX + 1) + ')').className = 'active';
                }
            });
        }
        document.addEventListener('DOMContentLoaded', loaded, false);
    </script>
</head>

<body class="reg-bk allcenter reg-c">
<header>
    <div class="reg-c" style="position:relative;"><img
            src="${tpl.get('header_img') or '%s/static/common/public/sz-telecom/zglt/images/header-bg.jpg'%requri}"
            width="100%"/>
        <a href="tel:4000309309" class="kf_tel"></a>
        <!-- tel:4000309309 -->

    </div>
</header>


<div class="reg-c" style=" margin:5px 0px 5px 0px;  /*text-indent: 2em;*/min-height: 173px; ">
    <!--输入框-->
    <form action="/login" method="post" name="getPass" id="loginForm" class="center">
        <input id="checkPic" type="checkbox" name="memberPass" class="" onclick="return agree();" checked>
        <label for="checkPic" style="display: inline-block;padding:0px;">本人接受<a href="/xieyi?tpl_name=common"
                                                                                style="color:#fb2323;">沃云无线网络信息安全协议</a></label>
            <span style="font-size: 12px; color: #C0BFBF;display: block;margin-bottom:10px;">
				${handler.xsrf_form_html()}
                <input type="hidden" name="qstr" value="${qstr or ''}">
			<div class="n-user">
                <input id="username" type="tel" name="username" class="newTxt b100 input-reg" value=""
                       placeholder="用户名：" style="width:72%;display: inline-block;"><a id="tiyan"
                                                                                      href="http://112.84.178.41/siwifiweb/experience"
                                                                                      class="btr">免费注册</a>
            </div>
            <div class="n-pwd">
                <input id="password" type="password" name="password" class="newTxt b100 input-reg" value=""
                       placeholder="密码：" style="width:72%;display: inline-block;"><a
                    href="http://112.84.178.41/siwifiweb/toWjPwd" class="btr">忘记密码</a>
            </div>
        </span>
        % if msg:
            <div style="font-size: 12px;padding: 0 10px;color: #F16364;padding-bottom: 5px;">${msg}</div>
        % endif
        <a class="pass-button b100 " onclick="doSubmit()" style="width: 48%;
  float: left;">登&nbsp;&nbsp;录</a>
        <a id="onlinepay" href="http://112.84.178.41/siwifiweb/onlinePaySelect?phone=" class="online-chong bt "
           style="width: 48%;
  float: right;">在线充值</a>
        </p>


    </form>
    <div class="clr"></div>

</div>


<!--幻灯片-->
<div class="banner">

    <div id="wrapper">
        <div id="scroller">
            <ul id="thelist">

                <li><p></p><img src="${tpl.get('ad1_img') or '%s/static/common/public/sz-telecom/zglt/images/1.jpg'%requri}">
                </li>
                <li><p></p><img src="${tpl.get('ad2_img') or '%s/static/common/public/sz-telecom/zglt/images/2.jpg'%requri}">
                </li>

            </ul>
        </div>
    </div>

    <div id="nav">
        <div id="prev" onclick="myScroll.scrollToPage('prev', 0,400,3);return false">&larr; prev</div>
        <ul id="indicator">
            <li class="active">1</li>
            <li>2</li>

        </ul>
        <div id="next" onclick="myScroll.scrollToPage('next', 0,400,3);return false">next &rarr;</div>
    </div>
    <div class="clr"></div>
</div>

<!--幻灯片end-->


<footer>
    <div class="copyight" style="margin:5px 0px 5px 0px;">
        <div class="reg-c" style=" margin:5px 0px 5px 0px;padding:5px 10px;">
            © ${tpl.get('copyright') or u'2015 沃云网络 版权所有'} </div>
    </div>
</footer>

<script type='text/javascript'>
    function doSubmit() {
        var m = $("#username");
        //if( !(/^1[3|4|5|7|8][0-9]\d{8}$/.test(m.val())))
        //{
        //	alert('请正确填写您的手机号！');
        //	m.focus();
        //	return false;
        //}
        //else
        if (m.val() == '') {
            alert('请填写您的用户账号！');
            m.focus();
            return false;
        }
        else if (!$('#checkPic').is(':checked')) {
            alert('必须勾选"我已阅读中国联通信息安全协议"！');
            return false;
        }
        else if ($("#password").val() == '' || $("#password").val().length < 6 || $("#password").val().length > 18) {
            alert('请输入密码,且密码长度在6-18位之间！');
            return false;
        }
        else {
            params = {
                _xsrf: '${handler.xsrf_token}',
                username: $("#username").val(),
                password: $("#password").val(),
                mac: "${mac}",
                domain: "${domain}"
            };
            $.post("/iklogin", params, function (ev) {
                console.log(ev);
                console.log(ev.msg);
                if (ev.code == 0) {
                    ikLogin();
                } else {
                    alert(ev.msg);
                }
            }, "json");
        }

    }

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null)
            return decodeURI(r[2]);
        return null;
    }

    $(function () {

        var ssid = getQueryString("ssid");
        var gwid = getQueryString("gwid");

        $("#ssid").val(ssid);
        $("#gwid").val(gwid);

        $('#tiyan').attr('href', 'http://112.84.178.41/siwifiweb/experience?ssid=' + ssid + '&gwid=' + gwid);
    });


</script>

<script type="text/javascript" src="http://portal.ikuai8.com/sdk/ikAuth.js"></script>
</body>
</html>
<script>
    var count = document.getElementById("thelist").getElementsByTagName("img").length;

    for (i = 0; i < count; i++) {
        document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";

    }
    document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";

    setInterval(function () {
        myScroll.scrollToPage('next', 0, 400, count);
    }, 3500);
    window.onresize = function () {
        for (i = 0; i < count; i++) {
            document.getElementById("thelist").getElementsByTagName("img").item(i).style.cssText = " width:" + document.body.clientWidth + "px";
        }
        document.getElementById("scroller").style.cssText = " width:" + document.body.clientWidth * count + "px";
    }


</script>
